Don't ignore errors from g_option_context_parse().
authorMatthias Clasen <mclasen@redhat.com>
Tue, 6 Dec 2005 16:44:31 +0000 (16:44 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 6 Dec 2005 16:44:31 +0000 (16:44 +0000)
2005-12-06  Matthias Clasen  <mclasen@redhat.com>

* gdk/gdk.c (gdk_parse_args):
* gtk/gtkmain.c (gtk_parse_args): Don't ignore errors
from g_option_context_parse().

ChangeLog
ChangeLog.pre-2-10
gdk/gdk.c
gtk/gtkmain.c

index 71cd1bf0336a47e5f8b28fa55833e96d61467366..9ebbb776f8f2c2b43e9a3d133712edb058838c69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-06  Matthias Clasen  <mclasen@redhat.com>
+
+       * gdk/gdk.c (gdk_parse_args): 
+       * gtk/gtkmain.c (gtk_parse_args): Don't ignore errors
+       from g_option_context_parse(). 
+
 Tue Dec  6 11:37:59 2005  Tim Janik  <timj@gtk.org>
 
        * gdk/gdkevents.c (gdk_event_new): fix missing hash table 
index 71cd1bf0336a47e5f8b28fa55833e96d61467366..9ebbb776f8f2c2b43e9a3d133712edb058838c69 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-06  Matthias Clasen  <mclasen@redhat.com>
+
+       * gdk/gdk.c (gdk_parse_args): 
+       * gtk/gtkmain.c (gtk_parse_args): Don't ignore errors
+       from g_option_context_parse(). 
+
 Tue Dec  6 11:37:59 2005  Tim Janik  <timj@gtk.org>
 
        * gdk/gdkevents.c (gdk_event_new): fix missing hash table 
index 2a89fe0e54acfe6d8fa1b5eb0ac75d7c0d21619f..84e03fd86a03d33d909bef5117852a384449b455 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -201,6 +201,7 @@ gdk_parse_args (int    *argc,
 {
   GOptionContext *option_context;
   GOptionGroup *option_group;
+  GError *error = NULL;
 
   if (gdk_initialized)
     return;
@@ -216,7 +217,11 @@ gdk_parse_args (int    *argc,
   g_option_group_add_entries (option_group, gdk_args);
   g_option_group_add_entries (option_group, _gdk_windowing_args);
 
-  g_option_context_parse (option_context, argc, argv, NULL);
+  if (g_option_context_parse (option_context, argc, argv, &error))
+    {
+      g_warning ("%s", error->message);
+      g_error_free (error);
+    }
   g_option_context_free (option_context);
   
   GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
index 3f9f54d98d8b311e28b3f372c805012a306fe05c..ecc35906f6d555204614847cc46b1d8854e5d894 100644 (file)
@@ -673,6 +673,7 @@ gtk_parse_args (int    *argc,
 {
   GOptionContext *option_context;
   GOptionGroup *gtk_group;
+  GError *error = NULL;
   
   if (gtk_initialized)
     return TRUE;
@@ -687,7 +688,12 @@ gtk_parse_args (int    *argc,
   g_option_context_set_help_enabled (option_context, FALSE);
   gtk_group = gtk_get_option_group (FALSE);
   g_option_context_set_main_group (option_context, gtk_group);
-  g_option_context_parse (option_context, argc, argv, NULL);
+  if (!g_option_context_parse (option_context, argc, argv, &error))
+    {
+      g_warning ("%s", error->message);
+      g_error_free (error);
+    }
+
   g_option_context_free (option_context);
 
   return TRUE;